'''
默认全局配置
'''
import os
import shutil

# D:\Code\TotalMarkDown\Python\VS_Code\settings.json
isFile_first = True;

arrList = ['C:\/Users\/wangwenli\/AppData\/Roaming\/Code\/User\/snippets' ]
arrCopyFile = [
    'Python\VS_Code\snippet_code.code-snippets', 
    'Python\VS_Code\elevatorForm.code-snippets', 
    'Python\VS_Code\/useFunction.code-snippets', 
    'Python\VS_Code\/react_typescript.code-snippets']


def copyFile(target):
    try:
        for fileValue in arrCopyFile:
            shutil.copy(os.path.join(os.getcwd(), fileValue),target)
            print('复制成功：' + target)
    except IOError as e:
        print("Unable to copy file. %s" % e)
    except:
        print("Unexpected error:")


for fileValue in arrCopyFile:
    isFile_first = os.path.exists(os.path.join(os.getcwd(), fileValue))
    if isFile_first == False:
        print(os.path.join(os.getcwd(), fileValue))
        break;

if isFile_first:
    for item in arrList:
        if os.path.exists(item):
            copyFile(item)
           
else: print('请检查文件')



    


    